<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<html>

<head>
    <title>秒杀详情页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" th:href="@{http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css}"/>
    <!--jQery文件,务必在bootstrap.min.js之前引入-->
    <script type="text/javascript" th:src="@{http://apps.bdimg.com/libs/jquery/2.0.0/jquery.min.js}"></script>
    <script type="text/javascript" th:src="@{http://apps.bdimg.com/libs/bootstrap/3.3.0/js/bootstrap.min.js}"></script>
    <!--使用CDN 获取公共js http://www.bootcdn.cn-->
    <!--jQuery Cookie操作插件-->
    <script type="text/javascript" th:src="@{http://cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js}"></script>
    <!--jQuery countDown倒计时插件-->
    <script type="text/javascript" th:src="@{http://cdn.bootcss.com/jquery.countdown/2.1.0/jquery.countdown.min.js}"></script>

    <script type="text/javascript" th:src="@{/js/seckill.js}"></script>
</head>

<body>

<div class="container">
    <div class="panel-heading">秒杀商品详情</div>
    <div class="panel panel-default text-center">
        <a id="logout">登出</a>
        <div class="pannel-top">
            <h3 id="user"></h3>
        </div>
        <table class="table" id="goodslist">
            <tr>
                <td>商品名称</td>
                <td colspan="3" th:text="${goods.name}"></td>
            </tr>
            <tr>
                <td>商品图片</td>
                <td colspan="3"><img th:src="@{${goods.goodsImg}}" width="200" height="200"/></td>
            </tr>
            <tr>
                <td>秒杀开始时间</td>
                <td th:text="${#dates.format(goods.startTime,'yyyy-MM-dd HH:mm:ss')}"></td>
            </tr>
        </table>

        <div class="panel-body">
            <h2 class="text-danger">
                <!--显示time图标-->
                <span class="glyphicon glyphicon-time"></span>
                <!--展示倒计时-->
                <span class="glyphicon" id="goods-box"></span>
            </h2>
        </div>
    </div>
</div>

<!--登录弹出层 输入电话-->
<div id="killPhoneModal" class="modal fade">

    <div class="modal-dialog">

        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title text-center">
                    <span class="glyphicon glyphicon-phone"> </span>秒杀电话
                </h3>
            </div>

            <div class="modal-body">
                <div class="row">
                    <div class="col-xs-8 col-xs-offset-2">
                        <input type="text" name="killPhone" id="killPhoneKey" placeholder="填写手机号" class="form-control">
                    </div>
                </div>
            </div>

            <div class="modal-footer">
                <!--验证信息-->
                <span id="killPhoneMessage" class="glyphicon"> </span>
                <button type="button" id="killPhoneBtn" class="btn btn-success">
                    <span class="glyphicon glyphicon-phone"></span>
                    Submit
                </button>
            </div>

        </div>
    </div>

</div>

</body>


<script type="text/javascript">
    $(function () {
        //使用EL表达式传入参数
        goods.detail.init({
        	goodsId:[[${goods.id}]],
            startTime:[[${goods.startTime.time}]],//毫秒
            endTime:[[${goods.endTime.time}]]
        });
    })
</script>
</html>
